package com.bdqn.dao;

import com.bdqn.pojo.UserPojo;

import java.sql.ResultSet;

public class UserDao {

    public static UserPojo login(String name,String pass) throws Exception {
        ResultSet set=BaseDao.getResultSet("select * from" +
                " usertable where name=?" +
                " and pass=?",new Object[]{name,pass});
        UserPojo pojo=new UserPojo(0,"","");
        if(set.next())
        {
            pojo.setName(set.getString("name"));
            pojo.setPass(set.getString("pass"));
        }
        return pojo;
    }
}
